#!/bin/bash
echo "[INFO] $(date +%Y-%m-%d_%H:%M%S) Begin import" >> /root/import.log
source /etc/profile
dateStr=`date "+%Y%m%d"`
echo "[INFO] Date---->${dateStr}"
log_path=/user_clicks/${dateStr}/
hive -e "use default; load data inpath '${log_path}' into table user_clicks partition(dt='${dateStr}');"
echo "[INFO] $(date +%Y-%m-%d_%H:%M%S) End analysis" >> /root/import.log